package com.api.tag.unfollow;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.test.context.ContextConfiguration;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import com.api.test.AbstractApiTest;
import com.zyncro.api.ITagApiService;
import com.zyncro.api.exceptions.ZyncroApiException;

@ContextConfiguration(locations = { "classpath:/tags/tags-context.xml" })
public class UnfollowTagExternal extends AbstractApiTest {

	@Value("#{statictags['user.external'].appId}")
	private String externalUrn;

	@Value("#{statictags['user.external'].password}")
	private String externalPassword;

	@Value("#{statictags['category.urn']}")
	private String categoryToUnfollowUrn;

	@Value("#{statictags['location.urn']}")
	private String locationToUnfollowUrn;

	@BeforeClass
	protected void setParameters() throws Exception {

		getApi().login(externalUrn, externalPassword);
	}

	@Test(expectedExceptions = { ZyncroApiException.class })
	public void testUnfollowCategory() throws ZyncroApiException {

		getApi().getService(ITagApiService.class).unfollowTag(categoryToUnfollowUrn);
	}

	@Test(expectedExceptions = { ZyncroApiException.class })
	public void testUnfollowLocation() throws ZyncroApiException {

		getApi().getService(ITagApiService.class).unfollowTag(locationToUnfollowUrn);
	}
}
